package com.byapp.fast.common.exception;

import com.byapp.fast.common.enums.ResultEnum;
import lombok.Getter;

/**
 * 自定义异常
 */
@Getter
public class BYException extends RuntimeException {

    private static final long serialVersionUID = -6521406851353005998L;

    private final Integer code;

    public BYException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
    }

    public BYException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

}
